Dec

General Operation Statement

Syntax samples

DEC <name>{, <expression>}

DEC Var1

DEC Attr1, 5

Description

Decrements a variable, array element, or attribute by the value of a specified numeric expression. To decrement a variable, attribute, or array element when the current entity actually leaves a location, use DEC in the move logic.

Valid In

Any logic.

Components

<name>

Any variable, array element, or attribute.

<expression>

The amount to decrement the value. If this expression is omitted, the value will be decremented by one. This can be a negative number.

Example

The example below shows two variables decremented in exit logic. The variable Num_in_system is decremented by one, while variable Var3 is decremented by 20.

 

 

See Also

INC. Also see Numeric Expressions.